<?php
if($id == $session->read('Auth.User.id'))
{?>
	<?php $latestRecipes = $this->requestAction('/listings/index/my',array('vars'=>true,'named'=>array('user'=>$user['User']['slug'],'limit'=>3)));?>
	<?php $title = __('Your Latest Listings',true)?>
	<?php $urlParam = "myListings"?>
<?php }else{?>
	<?php $latestRecipes = $this->requestAction('/listings/index/user',array('vars'=>true,'named'=>array('user'=>$user['User']['slug'],'limit'=>3)));?>
	<?php $title = sprintf(__('Latest Listings added by %s',true),$user['User']['display_name']);?>
	<?php $urlParam = "userListings"?>
<?php }?>
<div class="clear"></div>


<?php if(!empty($latestRecipes)){?>
	<h3>
		<span class="fl"><?php echo $title?></span>
		<span class="fr all">
			<?php echo $html->link(__('All Listings'),SiteUrl::getUrl($urlParam,array('user'=>$user['User']['slug'])));?>
		</span>
		<div class="clear"></div>
	</h3>
	<?php echo $this->element('listings',array('listings'=>$latestRecipes,'view_type'=>cr('ListingConfig.view_type')))?>
<?php }?>